<?php

use Biz\service\GoodsDetail as sGoodsDetail;
use Biz\tools\GoodsExposureLog;
use Biz\pockets\constInterface\ActivityInfo;
use Biz\service\activity\PinTuan as sPinTuan;

/**
 * @deprecated
 */
class RecommendAction extends ActionPlugin implements ActivityInfo
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {

        $goods_id = $this->getRequest()->getQuery('goods_id', 0);
        $province_id = $this->getRequest()->getQuery('province_id', 0);
        $cityId = $this->getRequest()->getQuery('city_id', 0);
        $activityType = $this->getRequest()->getQuery('activity_type', 0);
        $areaCode = $cityId ? $cityId : $province_id;

        if ($activityType == self::ACTIVITY_TYPE_PINTUAN) {
            $goodsInfos = sPinTuan::recommendGoods($goods_id);
        } else {
            $goodsInfos = sGoodsDetail::recommendGoods3_4($goods_id, $areaCode);
        }
        GoodsExposureLog::addLog($this->getRequest(), $goodsInfos,$goods_id);
        $this->setSuccess($goodsInfos);

    }

}
